// 
// Segmented Control
// ==============================

// base

.SegmentedControl {
	.display-flex();
	font-size: @font-size-xs;
}

// with gutter

.SegmentedControl--has-gutter {
	padding: @gutter-sm;
}

// with dark background

.SegmentedControl--inline {
	.display-inline-flex();
}

// with equal widths

.SegmentedControl--equal-widths > .SegmentedControl__item {
	.flex(1,1,0);
}

// options

.SegmentedControl__item {
	.flex-grow(1);
	.u-text-truncate();
	background-color: white;
	border: none;
	box-shadow: 0 0 0 1px @link-color;
	color: @link-color;
	cursor: pointer;
	line-height: @segmented-control-height;
	padding-left: 1em;
	padding-right: 1em;
	text-align: center;

	&:first-child { .border-left-radius( @border-radius-small ); }
	&:last-child { .border-right-radius( @border-radius-small ); }

	
	// tapped state

	&.Tappable-active {
		background-color: @item-bg-tap;
	}
}

// variants

.control-variant(@color) {
	box-shadow: 0 0 0 1px @color;
	color: @color;

	&.is-selected {
		background-color: @color;
		color: white;
	}
}

.SegmentedControl--default > .SegmentedControl__item  { .control-variant(@text-color); }
.SegmentedControl--primary > .SegmentedControl__item  { .control-variant(@app-primary); }
.SegmentedControl--muted > .SegmentedControl__item    { .control-variant(@gray-light); }

